<!DOCTYPE html>
<html id="docs" lang="en" class="">
	<head>
	<meta charset="utf-8">
<title>Running Kubernetes Locally via Minikube - Kubernetes</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="../../../images/favicon.png">
<link rel="stylesheet" type="text/css" href="../../../css/base_fonts.css">
<link rel="stylesheet" type="text/css" href="../../../css/styles.css">
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="../../../css/callouts.css">
<link rel="stylesheet" type="text/css" href="../../../css/custom-jekyll/tags.css">




<meta name="description" content="Running Kubernetes Locally via Minikube" />
<meta property="og:description" content="Running Kubernetes Locally via Minikube" />

<meta property="og:url" content="https://kubernetes.io/docs/setup/minikube/" />
<meta property="og:title" content="Running Kubernetes Locally via Minikube - Kubernetes" />

<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<script src="../../../js/script.js"></script>
<script src="../../../js/custom-jekyll/tags.js"></script>


	</head>
	<body>
		<div id="cellophane" onclick="kub.toggleMenu()"></div>

<header>
    <a href="../../../index.html" class="logo"></a>

    <div class="nav-buttons" data-auto-burger="primary">
        <ul class="global-nav">
            
            
            <li><a href="../../home.1">Documentation</a></li>
            
            <li><a href="../../../blog/index.html">Blog</a></li>
            
            <li><a href="../../../partners/index.html">Partners</a></li>
            
            <li><a href="../../../community/index.html">Community</a></li>
            
            <li><a href="../../../case-studies/index.html">Case Studies</a></li>
            
            
             <li>
                <a href="../../getting-started-guides/minikube/index.html#">
                    English <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="../../../zh/index.html">中文 Chinese</a></li>
                
                    <li><a href="../../../ko/index.html">한국어 Korean</a></li>
                
                </ul>
            </li>
         
            <li>
                <a href="../../getting-started-guides/minikube/index.html#">
                    v1.11 <span class="ui-icon ui-icon-carat-1-s"></span>
                </a>
                <ul>
                
                    <li><a href="https://kubernetes.io">v1.12</a></li>
                
                    <li><a href="../../../index.html">v1.11</a></li>
                
                    <li><a href="https://v1-10.docs.kubernetes.io">v1.10</a></li>
                
                    <li><a href="https://v1-9.docs.kubernetes.io">v1.9</a></li>
                
                </ul>
            </li>
        </ul>
        
        <a href="../../tutorials/kubernetes-basics/index.html" class="button" id="tryKubernetes" data-auto-burger-exclude>Try Kubernetes</a>
        <button id="hamburger" onclick="kub.toggleMenu()" data-auto-burger-exclude><div></div></button>
    </div>

    <nav id="mainNav">
        <main data-auto-burger="primary">
        <div class="nav-box">
            <h3><a href="../../tutorials/stateless-application/hello-minikube/index.html">Get Started</a></h3>
            <p>Ready to get your hands dirty? Build a simple Kubernetes cluster that runs "Hello World" for Node.js.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../home.1">Documentation</a></h3>
            <p>Learn how to use Kubernetes with the use of walkthroughs, samples, and reference documentation. You can even <a href="../../../editdocs/index.html" data-auto-burger-exclude>help contribute to the docs</a>!</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../community/index.html">Community</a></h3>
            <p>If you need help, you can connect with other Kubernetes users and the Kubernetes authors, attend community events, and watch video presentations from around the web.</p>
        </div>
        <div class="nav-box">
            <h3><a href="../../../blog/index.html">Blog</a></h3>
            <p>Read the latest news for Kubernetes and the containers space in general, and get technical how-tos hot off the presses.</p>
        </div>
        </main>
        <main data-auto-burger="primary">
        <div class="left">
            <h5 class="github-invite">Interested in hacking on the core Kubernetes code base?</h5>
            <a href="https://github.com/kubernetes/kubernetes" class="button" data-auto-burger-exclude>View On Github</a>
        </div>

        <div class="right">
            <h5 class="github-invite">Explore the community</h5>
            <div class="social">
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>Twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
        </div>
        <div class="clear" style="clear: both"></div>
        </main>
    </nav>
</header>

		
		
		<section id="hero" class="light-text no-sub">
			







<h1>Setup</h1>
<h5></h5>










<div id="vendorStrip" class="light-text">
	<ul>
		
		
		<li><a href="../../home.1">DOCUMENTATION</a></li>
		
		
		<li><a href="../index.html" class="YAH">SETUP</a></li>
		
		
		<li><a href="../../concepts/index.html">CONCEPTS</a></li>
		
		
		<li><a href="../../tasks/index.html">TASKS</a></li>
		
		
		<li><a href="../../tutorials/index.html">TUTORIALS</a></li>
		
		
		<li><a href="../../reference.1">REFERENCE</a></li>
		
	</ul>
	<div id="searchBox">
		<input type="text" id="search" placeholder="Search" onkeydown="if (event.keyCode==13) window.location.replace('/docs/search/?q=' + this.value)" autofocus="autofocus">
	</div>
</div>

		</section>
		
		
<section id="deprecationWarning">
  <main>
    <div class="content deprecation-warning">
      <h3>
        Documentation for Kubernetes v1.11 is no longer actively maintained. The version you are currently viewing is a static snapshot.
        For up-to-date documentation, see the <a href="https://kubernetes.io/docs/home/">latest</a> version.
      </h3>
    </div>
  </main>
</section>


		<section id="encyclopedia">
			
<div id="docsToc">
     <div class="pi-accordion">
    	
        
        
        
        
        
         
             
                 
             
         
             
                 
                          
                          
                 
             
         
             
         
             
         
             
         
             
         
             
         
             
         
         
        
        <a class="item" data-title="Setup" href="../index.html"></a>

	
	
		
		
	<div class="item" data-title="Bootstrapping Clusters with kubeadm">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Customizing control plane configuration with kubeadm" href="../independent/control-plane-flags/index.html"></a>

		
	
		
		
<a class="item" data-title="Creating Highly Available Clusters with kubeadm" href="../independent/high-availability.1"></a>

		
	
		
		
<a class="item" data-title="Creating a single master cluster with kubeadm" href="../../getting-started-guides/kubeadm/index.html"></a>

		
	
		
		
<a class="item" data-title="Troubleshooting kubeadm" href="../independent/troubleshooting-kubeadm/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Turnkey Cloud Solutions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Running Kubernetes on AWS EC2" href="../turnkey/aws/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Alibaba Cloud" href="../turnkey/alibaba-cloud/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Azure" href="../turnkey/azure/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on CenturyLink Cloud" href="../turnkey/clc/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Google Compute Engine" href="../turnkey/gce/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes on Multiple Clouds with Stackpoint.io" href="../turnkey/stackpoint/index.html"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="On-Premises VMs">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="Cloudstack" href="../../getting-started-guides/cloudstack/index.html"></a>

		
	
		
		
<a class="item" data-title="Kubernetes on DCOS" href="../../getting-started-guides/dcos/index.html"></a>

		
	
		
		
<a class="item" data-title="oVirt" href="../../getting-started-guides/ovirt.1"></a>

		
	

		</div>
	</div>

		
	
		
		
	<div class="item" data-title="Custom Cloud Solutions">
		<div class="container">
		
		
	
	
		
		
<a class="item" data-title="CoreOS on AWS or GCE" href="../../getting-started-guides/coreos.1"></a>

		
	
		
		
<a class="item" data-title="Installing Kubernetes On-premises/Cloud Providers with Kubespray" href="../../getting-started-guides/kubespray/index.html"></a>

		
	
		
		
<a class="item" data-title="Installing Kubernetes on AWS with kops" href="../custom-cloud/kops.1"></a>

		
	

		</div>
	</div>

		
	
		
		
<a class="item" data-title="Building Large Clusters" href="../cluster-large/index.html"></a>

		
	
		
		
<a class="item" data-title="Building from Source" href="../building-from-source/index.html"></a>

		
	
		
		
<a class="item" data-title="Configuring Kubernetes with Salt" href="../salt/index.html"></a>

		
	
		
		
<a class="item" data-title="Creating a Custom Cluster from Scratch" href="../../getting-started-guides/scratch/index.html"></a>

		
	
		
		
<a class="item" data-title="Picking the Right Solution" href="../../getting-started-guides/index.html"></a>

		
	
		
		
<a class="item" data-title="Running Kubernetes Locally via Minikube" href="../../getting-started-guides/minikube/index.html"></a>

		
	
		
		
<a class="item" data-title="Running in Multiple Zones" href="../multiple-zones.1"></a>

		
	
		
		
<a class="item" data-title="Validate Node Setup" href="../node-conformance/index.html"></a>

		
	






     </div> 
    <button class="push-menu-close-button" onclick="kub.toggleToc()"></button>
</div> 

			<div id="docsContent">
				
<p><a href="../../editdocs#docs/setup/minikube.md" id="editPageButton">Edit This Page</a></p>

<h1>Running Kubernetes Locally via Minikube</h1>





<p>Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.</p>

<nav id="TableOfContents">
<ul>
<li>
<ul>
<li>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#minikube-features">Minikube Features</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#installation">Installation</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#quickstart">Quickstart</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#alternative-container-runtimes">Alternative Container Runtimes</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#cri-o">CRI-O</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#rkt-container-engine">rkt container engine</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#driver-plugins">Driver plugins</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#reusing-the-docker-daemon">Reusing the Docker daemon</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#managing-your-cluster">Managing your Cluster</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#starting-a-cluster">Starting a Cluster</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#specifying-the-kubernetes-version">Specifying the Kubernetes version</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#configuring-kubernetes">Configuring Kubernetes</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#examples">Examples</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#stopping-a-cluster">Stopping a Cluster</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#deleting-a-cluster">Deleting a Cluster</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#interacting-with-your-cluster">Interacting With your Cluster</a>
<ul>
<li><a href="../../getting-started-guides/minikube/index.html#kubectl">Kubectl</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#dashboard">Dashboard</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#services">Services</a></li>
</ul></li>
<li><a href="../../getting-started-guides/minikube/index.html#networking">Networking</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#persistent-volumes">Persistent Volumes</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#mounted-host-folders">Mounted Host Folders</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#private-container-registries">Private Container Registries</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#add-ons">Add-ons</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#using-minikube-with-an-http-proxy">Using Minikube with an HTTP Proxy</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#known-issues">Known Issues</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#design">Design</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#additional-links">Additional Links:</a></li>
<li><a href="../../getting-started-guides/minikube/index.html#community">Community</a></li>
</ul></li>
</ul>
</nav>

<h3 id="minikube-features">Minikube Features</h3>

<ul>
<li>Minikube supports Kubernetes features such as:

<ul>
<li>DNS</li>
<li>NodePorts</li>
<li>ConfigMaps and Secrets</li>
<li>Dashboards</li>
<li>Container Runtime: Docker, <a href="https://github.com/rkt/rkt" target="_blank">rkt</a> and <a href="https://github.com/kubernetes-incubator/cri-o" target="_blank">CRI-O</a></li>
<li>Enabling CNI (Container Network Interface)</li>
<li>Ingress</li>
</ul></li>
</ul>

<h2 id="installation">Installation</h2>

<p>See <a href="../../tasks/tools/install-minikube/index.html">Installing Minikube</a>.</p>

<h2 id="quickstart">Quickstart</h2>

<p>Here&rsquo;s a brief demo of minikube usage.
If you want to change the VM driver add the appropriate <code>--vm-driver=xxx</code> flag to <code>minikube start</code>. Minikube supports
the following drivers:</p>

<ul>
<li>virtualbox</li>
<li>vmwarefusion</li>
<li>kvm2 (<a href="https://git.k8s.io/minikube/docs/drivers.md#kvm2-driver" target="_blank">driver installation</a>)</li>
<li>kvm (<a href="https://git.k8s.io/minikube/docs/drivers.md#kvm-driver" target="_blank">driver installation</a>)</li>
<li>hyperkit (<a href="https://git.k8s.io/minikube/docs/drivers.md#hyperkit-driver" target="_blank">driver installation</a>)</li>
<li>xhyve (<a href="https://git.k8s.io/minikube/docs/drivers.md#xhyve-driver" target="_blank">driver installation</a>) (deprecated)</li>
</ul>

<p>Note that the IP below is dynamic and can change. It can be retrieved with <code>minikube ip</code>.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ minikube start
Starting <span style="color:#a2f">local</span> Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting <span style="color:#a2f">local</span> Kubernetes cluster...

$ kubectl run hello-minikube --image<span style="color:#666">=</span>k8s.gcr.io/echoserver:1.10 --port<span style="color:#666">=</span><span style="color:#666">8080</span>
deployment <span style="color:#b44">&#34;hello-minikube&#34;</span> created
$ kubectl expose deployment hello-minikube --type<span style="color:#666">=</span>NodePort
service <span style="color:#b44">&#34;hello-minikube&#34;</span> exposed

<span style="color:#080;font-style:italic"># We have now launched an echoserver pod but we have to wait until the pod is up before curling/accessing it
</span><span style="color:#080;font-style:italic"># via the exposed service.
</span><span style="color:#080;font-style:italic"># To check whether the pod is up and running we can use the following:
</span><span style="color:#080;font-style:italic"></span>$ kubectl get pod
NAME                              READY     STATUS              RESTARTS   AGE
hello-minikube-3383150820-vctvh   <span style="color:#666">0</span>/1       ContainerCreating   <span style="color:#666">0</span>          3s
<span style="color:#080;font-style:italic"># We can see that the pod is still being created from the ContainerCreating status
</span><span style="color:#080;font-style:italic"></span>$ kubectl get pod
NAME                              READY     STATUS    RESTARTS   AGE
hello-minikube-3383150820-vctvh   <span style="color:#666">1</span>/1       Running   <span style="color:#666">0</span>          13s
<span style="color:#080;font-style:italic"># We can see that the pod is now Running and we will now be able to curl it:
</span><span style="color:#080;font-style:italic"></span>$ curl <span style="color:#a2f;font-weight:bold">$(</span>minikube service hello-minikube --url<span style="color:#a2f;font-weight:bold">)</span>
CLIENT VALUES:
<span style="color:#b8860b">client_address</span><span style="color:#666">=</span><span style="color:#666">192</span>.168.99.1
<span style="color:#b8860b">command</span><span style="color:#666">=</span>GET
real <span style="color:#b8860b">path</span><span style="color:#666">=</span>/
...
$ kubectl delete services hello-minikube
service <span style="color:#b44">&#34;hello-minikube&#34;</span> deleted
$ kubectl delete deployment hello-minikube
deployment <span style="color:#b44">&#34;hello-minikube&#34;</span> deleted
$ minikube stop
Stopping <span style="color:#a2f">local</span> Kubernetes cluster...
Stopping <span style="color:#b44">&#34;minikube&#34;</span>...</code></pre></div>
<h3 id="alternative-container-runtimes">Alternative Container Runtimes</h3>

<h4 id="cri-o">CRI-O</h4>

<p>To use <a href="https://github.com/kubernetes-incubator/cri-o" target="_blank">CRI-O</a> as the container runtime, run:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ minikube start <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --network-plugin<span style="color:#666">=</span>cni <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --container-runtime<span style="color:#666">=</span>cri-o <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --bootstrapper<span style="color:#666">=</span>kubeadm</code></pre></div>
<p>Or you can use the extended version:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ minikube start <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --network-plugin<span style="color:#666">=</span>cni <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --extra-config<span style="color:#666">=</span>kubelet.container-runtime<span style="color:#666">=</span>remote <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --extra-config<span style="color:#666">=</span>kubelet.container-runtime-endpoint<span style="color:#666">=</span>/var/run/crio.sock <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --extra-config<span style="color:#666">=</span>kubelet.image-service-endpoint<span style="color:#666">=</span>/var/run/crio.sock <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --bootstrapper<span style="color:#666">=</span>kubeadm</code></pre></div>
<h4 id="rkt-container-engine">rkt container engine</h4>

<p>To use <a href="https://github.com/rkt/rkt" target="_blank">rkt</a> as the container runtime run:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ minikube start <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --network-plugin<span style="color:#666">=</span>cni <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>    --container-runtime<span style="color:#666">=</span>rkt</code></pre></div>
<p>This will use an alternative minikube ISO image containing both rkt, and Docker, and enable CNI networking.</p>

<h3 id="driver-plugins">Driver plugins</h3>

<p>See <a href="https://git.k8s.io/minikube/docs/drivers.md" target="_blank">DRIVERS</a> for details on supported drivers and how to install
plugins, if required.</p>

<h3 id="reusing-the-docker-daemon">Reusing the Docker daemon</h3>

<p>When using a single VM of Kubernetes, it&rsquo;s really handy to reuse the minikube&rsquo;s built-in Docker daemon; as this means you don&rsquo;t have to build a docker registry on your host machine and push the image into it - you can just build inside the same docker daemon as minikube which speeds up local experiments. Just make sure you tag your Docker image with something other than &lsquo;latest&rsquo; and use that tag while you pull the image. Otherwise, if you do not specify version of your image, it will be assumed as <code>:latest</code>, with pull image policy of <code>Always</code> correspondingly, which may eventually result in <code>ErrImagePull</code> as you may not have any versions of your Docker image out there in the default docker registry (usually DockerHub) yet.</p>

<p>To be able to work with the docker daemon on your mac/linux host use the <code>docker-env command</code> in your shell:</p>

<pre><code>eval $(minikube docker-env)
</code></pre>

<p>You should now be able to use docker on the command line on your host mac/linux machine talking to the docker daemon inside the minikube VM:</p>

<pre><code>docker ps
</code></pre>

<p>On Centos 7, docker may report the following error:</p>

<pre><code>Could not read CA certificate &quot;/etc/docker/ca.pem&quot;: open /etc/docker/ca.pem: no such file or directory
</code></pre>

<p>The fix is to update /etc/sysconfig/docker to ensure that minikube&rsquo;s environment changes are respected:</p>

<pre><code>&lt; DOCKER_CERT_PATH=/etc/docker
---
&gt; if [ -z &quot;${DOCKER_CERT_PATH}&quot; ]; then
&gt;   DOCKER_CERT_PATH=/etc/docker
&gt; fi
</code></pre>

<p>Remember to turn off the imagePullPolicy:Always, as otherwise Kubernetes won&rsquo;t use images you built locally.</p>

<h2 id="managing-your-cluster">Managing your Cluster</h2>

<h3 id="starting-a-cluster">Starting a Cluster</h3>

<p>The <code>minikube start</code> command can be used to start your cluster.
This command creates and configures a virtual machine that runs a single-node Kubernetes cluster.
This command also configures your <a href="../../user-guide/kubectl-overview/index.html">kubectl</a> installation to communicate with this cluster.</p>

<p>If you are behind a web proxy, you will need to pass this information in e.g. via</p>

<pre><code>https_proxy=&lt;my proxy&gt; minikube start --docker-env http_proxy=&lt;my proxy&gt; --docker-env https_proxy=&lt;my proxy&gt; --docker-env no_proxy=192.168.99.0/24
</code></pre>

<p>Unfortunately just setting the environment variables will not work.</p>

<p>Minikube will also create a &ldquo;minikube&rdquo; context, and set it to default in kubectl.
To switch back to this context later, run this command: <code>kubectl config use-context minikube</code>.</p>

<h4 id="specifying-the-kubernetes-version">Specifying the Kubernetes version</h4>

<p>Minikube supports running multiple different versions of Kubernetes. You can
access a list of all available versions via</p>

<pre><code>minikube get-k8s-versions
</code></pre>

<p>You can specify the specific version of Kubernetes for Minikube to use by
adding the <code>--kubernetes-version</code> string to the <code>minikube start</code> command. For
example, to run version <code>v1.7.3</code>, you would run the following:</p>

<pre><code>minikube start --kubernetes-version v1.7.3
</code></pre>

<h3 id="configuring-kubernetes">Configuring Kubernetes</h3>

<p>Minikube has a &ldquo;configurator&rdquo; feature that allows users to configure the Kubernetes components with arbitrary values.
To use this feature, you can use the <code>--extra-config</code> flag on the <code>minikube start</code> command.</p>

<p>This flag is repeated, so you can pass it several times with several different values to set multiple options.</p>

<p>This flag takes a string of the form <code>component.key=value</code>, where <code>component</code> is one of the strings from the below list, <code>key</code> is a value on the
configuration struct and <code>value</code> is the value to set.</p>

<p>Valid keys can be found by examining the documentation for the Kubernetes <code>componentconfigs</code> for each component.
Here is the documentation for each supported configuration:</p>

<ul>
<li><a href="https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig#KubeletConfiguration" target="_blank">kubelet</a></li>
<li><a href="https://godoc.org/k8s.io/kubernetes/cmd/kube-apiserver/app/options#ServerRunOptions" target="_blank">apiserver</a></li>
<li><a href="https://godoc.org/k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig#KubeProxyConfiguration" target="_blank">proxy</a></li>
<li><a href="https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeControllerManagerConfiguration" target="_blank">controller-manager</a></li>
<li><a href="https://godoc.org/github.com/coreos/etcd/etcdserver#ServerConfig" target="_blank">etcd</a></li>
<li><a href="https://godoc.org/k8s.io/kubernetes/pkg/apis/componentconfig#KubeSchedulerConfiguration" target="_blank">scheduler</a></li>
</ul>

<h4 id="examples">Examples</h4>

<p>To change the <code>MaxPods</code> setting to 5 on the Kubelet, pass this flag: <code>--extra-config=kubelet.MaxPods=5</code>.</p>

<p>This feature also supports nested structs. To change the <code>LeaderElection.LeaderElect</code> setting to <code>true</code> on the scheduler, pass this flag: <code>--extra-config=scheduler.LeaderElection.LeaderElect=true</code>.</p>

<p>To set the <code>AuthorizationMode</code> on the <code>apiserver</code> to <code>RBAC</code>, you can use: <code>--extra-config=apiserver.Authorization.Mode=RBAC</code>.</p>

<h3 id="stopping-a-cluster">Stopping a Cluster</h3>

<p>The <code>minikube stop</code> command can be used to stop your cluster.
This command shuts down the minikube virtual machine, but preserves all cluster state and data.
Starting the cluster again will restore it to it&rsquo;s previous state.</p>

<h3 id="deleting-a-cluster">Deleting a Cluster</h3>

<p>The <code>minikube delete</code> command can be used to delete your cluster.
This command shuts down and deletes the minikube virtual machine. No data or state is preserved.</p>

<h2 id="interacting-with-your-cluster">Interacting With your Cluster</h2>

<h3 id="kubectl">Kubectl</h3>

<p>The <code>minikube start</code> command creates a &ldquo;<a href="../../reference/generated/kubectl/kubectl-commands/index.html#-em-set-context-em-">kubectl context</a>&rdquo; called &ldquo;minikube&rdquo;.
This context contains the configuration to communicate with your minikube cluster.</p>

<p>Minikube sets this context to default automatically, but if you need to switch back to it in the future, run:</p>

<p><code>kubectl config use-context minikube</code>,</p>

<p>Or pass the context on each command like this: <code>kubectl get pods --context=minikube</code>.</p>

<h3 id="dashboard">Dashboard</h3>

<p>To access the <a href="../../tasks/web-ui-dashboard/index.html">Kubernetes Dashboard</a>, run this command in a shell after starting minikube to get the address:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">minikube dashboard</code></pre></div>
<h3 id="services">Services</h3>

<p>To access a service exposed via a node port, run this command in a shell after starting minikube to get the address:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">minikube service <span style="color:#666">[</span>-n NAMESPACE<span style="color:#666">]</span> <span style="color:#666">[</span>--url<span style="color:#666">]</span> NAME</code></pre></div>
<h2 id="networking">Networking</h2>

<p>The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the <code>minikube ip</code> command.
Any services of type <code>NodePort</code> can be accessed over that IP address, on the NodePort.</p>

<p>To determine the NodePort for your service, you can use a <code>kubectl</code> command like this:</p>

<p><code>kubectl get service $SERVICE --output='jsonpath=&quot;{.spec.ports[0].nodePort}&quot;'</code></p>

<h2 id="persistent-volumes">Persistent Volumes</h2>

<p>Minikube supports <a href="../../user-guide/persistent-volumes/index.html">PersistentVolumes</a> of type <code>hostPath</code>.
These PersistentVolumes are mapped to a directory inside the minikube VM.</p>

<p>The Minikube VM boots into a tmpfs, so most directories will not be persisted across reboots (<code>minikube stop</code>).
However, Minikube is configured to persist files stored under the following host directories:</p>

<ul>
<li><code>/data</code></li>
<li><code>/var/lib/localkube</code></li>
<li><code>/var/lib/docker</code></li>
</ul>

<p>Here is an example PersistentVolume config to persist data in the <code>/data</code> directory:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml">apiVersion:<span style="color:#bbb"> </span>v1<span style="color:#bbb">
</span><span style="color:#bbb"></span>kind:<span style="color:#bbb"> </span>PersistentVolume<span style="color:#bbb">
</span><span style="color:#bbb"></span>metadata:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>name:<span style="color:#bbb"> </span>pv0001<span style="color:#bbb">
</span><span style="color:#bbb"></span>spec:<span style="color:#bbb">
</span><span style="color:#bbb">  </span>accessModes:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>-<span style="color:#bbb"> </span>ReadWriteOnce<span style="color:#bbb">
</span><span style="color:#bbb">  </span>capacity:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>storage:<span style="color:#bbb"> </span>5Gi<span style="color:#bbb">
</span><span style="color:#bbb">  </span>hostPath:<span style="color:#bbb">
</span><span style="color:#bbb">    </span>path:<span style="color:#bbb"> </span>/data/pv0001/</code></pre></div>
<h2 id="mounted-host-folders">Mounted Host Folders</h2>

<p>Some drivers will mount a host folder within the VM so that you can easily share files between the VM and host.  These are not configurable at the moment and different for the driver and OS you are using.</p>

<p><strong>Note:</strong> Host folder sharing is not implemented in the KVM driver yet.</p>

<table>
<thead>
<tr>
<th>Driver</th>
<th>OS</th>
<th>HostFolder</th>
<th>VM</th>
</tr>
</thead>

<tbody>
<tr>
<td>VirtualBox</td>
<td>Linux</td>
<td>/home</td>
<td>/hosthome</td>
</tr>

<tr>
<td>VirtualBox</td>
<td>OSX</td>
<td>/Users</td>
<td>/Users</td>
</tr>

<tr>
<td>VirtualBox</td>
<td>Windows</td>
<td>C://Users</td>
<td>/c/Users</td>
</tr>

<tr>
<td>VMware Fusion</td>
<td>OSX</td>
<td>/Users</td>
<td>/Users</td>
</tr>

<tr>
<td>Xhyve</td>
<td>OSX</td>
<td>/Users</td>
<td>/Users</td>
</tr>
</tbody>
</table>

<h2 id="private-container-registries">Private Container Registries</h2>

<p>To access a private container registry, follow the steps on <a href="../../concepts/containers/images/index.html">this page</a>.</p>

<p>We recommend you use <code>ImagePullSecrets</code>, but if you would like to configure access on the minikube VM you can place the <code>.dockercfg</code> in the <code>/home/docker</code> directory or the <code>config.json</code> in the <code>/home/docker/.docker</code> directory.</p>

<h2 id="add-ons">Add-ons</h2>

<p>In order to have minikube properly start or restart custom addons,
place the addons you wish to be launched with minikube in the <code>~/.minikube/addons</code>
directory. Addons in this folder will be moved to the minikube VM and
launched each time minikube is started or restarted.</p>

<h2 id="using-minikube-with-an-http-proxy">Using Minikube with an HTTP Proxy</h2>

<p>Minikube creates a Virtual Machine that includes Kubernetes and a Docker daemon.
When Kubernetes attempts to schedule containers using Docker, the Docker daemon may require external network access to pull containers.</p>

<p>If you are behind an HTTP proxy, you may need to supply Docker with the proxy settings.
To do this, pass the required environment variables as flags during <code>minikube start</code>.</p>

<p>For example:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ minikube start --docker-env <span style="color:#b8860b">http_proxy</span><span style="color:#666">=</span>http://<span style="color:#b8860b">$YOURPROXY</span>:PORT <span style="color:#b62;font-weight:bold">\
</span><span style="color:#b62;font-weight:bold"></span>                 --docker-env <span style="color:#b8860b">https_proxy</span><span style="color:#666">=</span>https://<span style="color:#b8860b">$YOURPROXY</span>:PORT</code></pre></div>
<p>If your Virtual Machine address is 192.168.99.100, then chances are your proxy settings will prevent kubectl from directly reaching it.
To by-pass proxy configuration for this IP address, you should modify your no_proxy settings. You can do so with:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ <span style="color:#a2f">export</span> <span style="color:#b8860b">no_proxy</span><span style="color:#666">=</span><span style="color:#b8860b">$no_proxy</span>,<span style="color:#a2f;font-weight:bold">$(</span>minikube ip<span style="color:#a2f;font-weight:bold">)</span></code></pre></div>
<h2 id="known-issues">Known Issues</h2>

<ul>
<li>Features that require a Cloud Provider will not work in Minikube. These include:

<ul>
<li>LoadBalancers</li>
</ul></li>
<li>Features that require multiple nodes. These include:

<ul>
<li>Advanced scheduling policies</li>
</ul></li>
</ul>

<h2 id="design">Design</h2>

<p>Minikube uses <a href="https://github.com/docker/machine/tree/master/libmachine" target="_blank">libmachine</a> for provisioning VMs, and <a href="https://git.k8s.io/minikube/pkg/localkube" target="_blank">localkube</a> (originally written and donated to this project by <a href="https://redspread.com/" target="_blank">RedSpread</a>) for running the cluster.</p>

<p>For more information about minikube, see the <a href="https://git.k8s.io/community/contributors/design-proposals/cluster-lifecycle/local-cluster-ux.md" target="_blank">proposal</a>.</p>

<h2 id="additional-links">Additional Links:</h2>

<ul>
<li><strong>Goals and Non-Goals</strong>: For the goals and non-goals of the minikube project, please see our <a href="https://git.k8s.io/minikube/docs/contributors/roadmap.md" target="_blank">roadmap</a>.</li>
<li><strong>Development Guide</strong>: See <a href="https://git.k8s.io/minikube/CONTRIBUTING.md" target="_blank">CONTRIBUTING.md</a> for an overview of how to send pull requests.</li>
<li><strong>Building Minikube</strong>: For instructions on how to build/test minikube from source, see the <a href="https://git.k8s.io/minikube/docs/contributors/build_guide.md" target="_blank">build guide</a></li>
<li><strong>Adding a New Dependency</strong>: For instructions on how to add a new dependency to minikube see the <a href="https://git.k8s.io/minikube/docs/contributors/adding_a_dependency.md" target="_blank">adding dependencies guide</a></li>
<li><strong>Adding a New Addon</strong>: For instruction on how to add a new addon for minikube see the <a href="https://git.k8s.io/minikube/docs/contributors/adding_an_addon.md" target="_blank">adding an addon guide</a></li>
<li><strong>Updating Kubernetes</strong>: For instructions on how to update kubernetes see the <a href="https://git.k8s.io/minikube/docs/contributors/updating_kubernetes.md" target="_blank">updating Kubernetes guide</a></li>
</ul>

<h2 id="community">Community</h2>

<p>Contributions, questions, and comments are all welcomed and encouraged! minikube developers hang out on <a href="https://kubernetes.slack.com" target="_blank">Slack</a> in the #minikube channel (get an invitation <a href="http://slack.kubernetes.io/" target="_blank">here</a>). We also have the <a href="https://groups.google.com/forum/#!forum/kubernetes-dev" target="_blank">kubernetes-dev Google Groups mailing list</a>. If you are posting to the list please prefix your subject with &ldquo;minikube: &ldquo;.</p>



				<div class="issue-button-container">
					<p><a href="../../getting-started-guides/minikube/index.html"><img src="https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/setup/minikube.md?pixel" alt="Analytics" /></a></p>
					
					
					<script type="text/javascript">
					PDRTJS_settings_8345992 = {
					"id" : "8345992",
					"unique_id" : "\/docs\/setup\/minikube\/",
					"title" : "Running Kubernetes Locally via Minikube",
					"permalink" : "https:\/\/kubernetes.io\/docs\/setup\/minikube\/"
					};
					(function(d,c,j){if(!document.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src=('https:'==document.location.protocol)?'https://polldaddy.com/js/rating/rating.js':'http://i0.poll.fm/js/rating/rating.js';s=document.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);}}(document,'script','pd-rating-js'));
					</script>
					<a href="../../getting-started-guides/minikube/index.html" onclick="window.open('https://github.com/kubernetes/website/issues/new?title=Issue%20with%20' +
					'k8s.io'+window.location.pathname)" class="button issue">Create an Issue</a>
					
					
					
					<a href="../../editdocs#docs/setup/minikube.md" class="button issue">Edit this Page</a>
					
				</div>
			</div>
		</section>
		<footer>
    <main class="light-text">
        <nav>
            
            
            
            <a href="../../home.1">Documentation</a>
            
            <a href="../../../blog/index.html">Blog</a>
            
            <a href="../../../partners/index.html">Partners</a>
            
            <a href="../../../community/index.html">Community</a>
            
            <a href="../../../case-studies/index.html">Case Studies</a>
            
        </nav>
        <div class="social">
            <div>
                <a href="https://twitter.com/kubernetesio" class="twitter"><span>twitter</span></a>
                <a href="https://github.com/kubernetes/kubernetes" class="github"><span>Github</span></a>
                <a href="http://slack.k8s.io/" class="slack"><span>Slack</span></a>
            </div>
            <div>
                <a href="http://stackoverflow.com/questions/tagged/kubernetes" class="stack-overflow"><span>Stack Overflow</span></a>
                <a href="https://discuss.kubernetes.io" class="mailing-list"><span>Forum</span></a>
                <a href="https://calendar.google.com/calendar/embed?src=nt2tcnbtbied3l6gi2h29slvc0%40group.calendar.google.com" class="calendar"><span>Events Calendar</span></a>
            </div>
            <div>
                <a href="../../getting-started-guides/index.html" class="button">Get Kubernetes</a>
                <a href="https://git.k8s.io/community/contributors/guide" class="button">Contribute</a>
            </div>
        </div>
        <div id="miceType" class="center">
            &copy; 2018 The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>
        </div>
        <div id="miceType" class="center">
            Copyright &copy; 2018 The Linux Foundation&reg;. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>
        </div>
    </main>
</footer>

		<button class="flyout-button" onclick="kub.toggleToc()"></button>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36037335-10', 'auto');
ga('send', 'pageview');


(function () {
    window.addEventListener('DOMContentLoaded', init)

        
        function init() {
            window.removeEventListener('DOMContentLoaded', init)
                hideNav()
        }

    function hideNav(toc){
        if (!toc) toc = document.querySelector('#docsToc')
        if (!toc) return
            var container = toc.querySelector('.container')

                
                if (container) {
                    if (container.childElementCount === 0 || toc.querySelectorAll('a.item').length === 1) {
                        toc.style.display = 'none'
                            document.getElementById('docsContent').style.width = '100%'
                    }
                } else {
                    requestAnimationFrame(function () {
                        hideNav(toc)
                    })
                }
    }
})();
</script>



	</body>
</html>